#ifndef RDSQL_H
#define RDSQL_H

#include "tracksql.h"

#define RDOG_GAMEID_SIZE		16
typedef char RedDogGameID[RDOG_GAMEID_SIZE];

class RedDogSavedGame;

//
// All money values are in cents (100 == $1, 25 == $.25, 1 == $.01)
//
// IMPORTANT:  Access to this class is NOT thread-safe.  That's handled at
//			   the next level up (with calls to lock()/unlock()).
//

class RedDogSQL : public TrackSQL
{
	public:
		RedDogSQL(const String& DBDSN, const String& DBLogin, const String& DBPassword);

		int32 createGame(int32 casinoId,
			PID, bool8 forMoney, SESSIONID, int32 compFactor,
			RedDogGameID, int32 bet, int32* balance, int32* comp);

		int32 deal(int32 casinoId, PID, bool8 forMoney, RedDogGameID,
			int32 numPlayer, uint8* player, uint8 ending, int32 outcome,
			int32 balanceAdjust, int32* balance, int32* comp);

		int32 gameDone(int32 casinoId, PID, bool8 forMoney, RedDogGameID, 
			uint8 ThirdCard, bool8 raised, int32 outcome,
			int32 balanceAdjust, int32* balance, int32* comp);

		int32 hasSavedGame(PID, bool8 forMoney,
			RedDogGameID, RedDogSavedGame*, bool8* exists);
		int32 removeSavedGame(RedDogGameID);
		int32 saveGame(PID, bool8 forMoney, RedDogGameID, RedDogSavedGame*);
};

#endif
